//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

package org.ryzom.nel.misc;

public class CPath {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CPath(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CPath obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CPath(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public static CPath getInstance() {
    long cPtr = nelmiscJNI.CPath_getInstance();
    return (cPtr == 0) ? null : new CPath(cPtr, false);
  }

  public static void addSearchPath(String path, boolean recurse, boolean alternative, IProgressCallback progressCallBack) {
    nelmiscJNI.CPath_addSearchPath__SWIG_0(path, recurse, alternative, IProgressCallback.getCPtr(progressCallBack), progressCallBack);
  }

  public static void addSearchPath(String path, boolean recurse, boolean alternative) {
    nelmiscJNI.CPath_addSearchPath__SWIG_1(path, recurse, alternative);
  }

  public static void addSearchPath(String path) {
    nelmiscJNI.CPath_addSearchPath__SWIG_2(path);
  }

  public static void addSearchFile(String file, boolean remap, String virtual_ext, IProgressCallback progressCallBack) {
    nelmiscJNI.CPath_addSearchFile__SWIG_0(file, remap, virtual_ext, IProgressCallback.getCPtr(progressCallBack), progressCallBack);
  }

  public static void addSearchFile(String file, boolean remap, String virtual_ext) {
    nelmiscJNI.CPath_addSearchFile__SWIG_1(file, remap, virtual_ext);
  }

  public static void addSearchFile(String file, boolean remap) {
    nelmiscJNI.CPath_addSearchFile__SWIG_2(file, remap);
  }

  public static void addSearchFile(String file) {
    nelmiscJNI.CPath_addSearchFile__SWIG_3(file);
  }

  public static void addSearchListFile(String filename, boolean recurse, boolean alternative) {
    nelmiscJNI.CPath_addSearchListFile(filename, recurse, alternative);
  }

  public static void addSearchBigFile(String filename, boolean recurse, boolean alternative, IProgressCallback progressCallBack) {
    nelmiscJNI.CPath_addSearchBigFile__SWIG_0(filename, recurse, alternative, IProgressCallback.getCPtr(progressCallBack), progressCallBack);
  }

  public static void addSearchBigFile(String filename, boolean recurse, boolean alternative) {
    nelmiscJNI.CPath_addSearchBigFile__SWIG_1(filename, recurse, alternative);
  }

  public static void addSearchXmlpackFile(String sXmlpackFilename, boolean recurse, boolean alternative, IProgressCallback progressCallBack) {
    nelmiscJNI.CPath_addSearchXmlpackFile__SWIG_0(sXmlpackFilename, recurse, alternative, IProgressCallback.getCPtr(progressCallBack), progressCallBack);
  }

  public static void addSearchXmlpackFile(String sXmlpackFilename, boolean recurse, boolean alternative) {
    nelmiscJNI.CPath_addSearchXmlpackFile__SWIG_1(sXmlpackFilename, recurse, alternative);
  }

  public static void removeAllAlternativeSearchPath() {
    nelmiscJNI.CPath_removeAllAlternativeSearchPath();
  }

  public static void removeBigFiles(Vector_String bnpFilenames) {
    nelmiscJNI.CPath_removeBigFiles(Vector_String.getCPtr(bnpFilenames), bnpFilenames);
  }

  public static String lookup(String filename, boolean throwException, boolean displayWarning, boolean lookupInLocalDirectory) {
    return nelmiscJNI.CPath_lookup__SWIG_0(filename, throwException, displayWarning, lookupInLocalDirectory);
  }

  public static String lookup(String filename, boolean throwException, boolean displayWarning) {
    return nelmiscJNI.CPath_lookup__SWIG_1(filename, throwException, displayWarning);
  }

  public static String lookup(String filename, boolean throwException) {
    return nelmiscJNI.CPath_lookup__SWIG_2(filename, throwException);
  }

  public static String lookup(String filename) {
    return nelmiscJNI.CPath_lookup__SWIG_3(filename);
  }

  public static boolean exists(String filename) {
    return nelmiscJNI.CPath_exists(filename);
  }

  public static void clearMap() {
    nelmiscJNI.CPath_clearMap();
  }

  public static void remapExtension(String ext1, String ext2, boolean substitute) {
    nelmiscJNI.CPath_remapExtension(ext1, ext2, substitute);
  }

  public static void remapFile(String file1, String file2) {
    nelmiscJNI.CPath_remapFile(file1, file2);
  }

  public static void loadRemappedFiles(String file) {
    nelmiscJNI.CPath_loadRemappedFiles(file);
  }

  public static void display() {
    nelmiscJNI.CPath_display();
  }

  public static String standardizePath(String path, boolean addFinalSlash) {
    return nelmiscJNI.CPath_standardizePath__SWIG_0(path, addFinalSlash);
  }

  public static String standardizePath(String path) {
    return nelmiscJNI.CPath_standardizePath__SWIG_1(path);
  }

  public static String standardizeDosPath(String path) {
    return nelmiscJNI.CPath_standardizeDosPath(path);
  }

  public static void getPathContent(String path, boolean recurse, boolean wantDir, boolean wantFile, Vector_String result, IProgressCallback progressCallBack, boolean showEverything) {
    nelmiscJNI.CPath_getPathContent__SWIG_0(path, recurse, wantDir, wantFile, Vector_String.getCPtr(result), result, IProgressCallback.getCPtr(progressCallBack), progressCallBack, showEverything);
  }

  public static void getPathContent(String path, boolean recurse, boolean wantDir, boolean wantFile, Vector_String result, IProgressCallback progressCallBack) {
    nelmiscJNI.CPath_getPathContent__SWIG_1(path, recurse, wantDir, wantFile, Vector_String.getCPtr(result), result, IProgressCallback.getCPtr(progressCallBack), progressCallBack);
  }

  public static void getPathContent(String path, boolean recurse, boolean wantDir, boolean wantFile, Vector_String result) {
    nelmiscJNI.CPath_getPathContent__SWIG_2(path, recurse, wantDir, wantFile, Vector_String.getCPtr(result), result);
  }

  public static String getFullPath(String path, boolean addFinalSlash) {
    return nelmiscJNI.CPath_getFullPath__SWIG_0(path, addFinalSlash);
  }

  public static String getFullPath(String path) {
    return nelmiscJNI.CPath_getFullPath__SWIG_1(path);
  }

  public static String getCurrentPath() {
    return nelmiscJNI.CPath_getCurrentPath();
  }

  public static boolean setCurrentPath(String path) {
    return nelmiscJNI.CPath_setCurrentPath(path);
  }

  public static void getFileList(String extension, Vector_String filenames) {
    nelmiscJNI.CPath_getFileList(extension, Vector_String.getCPtr(filenames), filenames);
  }

  public static void getFileListByName(String extension, String name, Vector_String filenames) {
    nelmiscJNI.CPath_getFileListByName(extension, name, Vector_String.getCPtr(filenames), filenames);
  }

  public static boolean makePathRelative(String basePath, SWIGTYPE_p_std__string relativePath) {
    return nelmiscJNI.CPath_makePathRelative(basePath, SWIGTYPE_p_std__string.getCPtr(relativePath));
  }

  public static void addIgnoredDoubleFile(String ignoredFile) {
    nelmiscJNI.CPath_addIgnoredDoubleFile(ignoredFile);
  }

  public static void memoryCompress() {
    nelmiscJNI.CPath_memoryCompress();
  }

  public static void memoryUncompress() {
    nelmiscJNI.CPath_memoryUncompress();
  }

  public static boolean isMemoryCompressed() {
    return nelmiscJNI.CPath_isMemoryCompressed();
  }

  public static String getWindowsDirectory() {
    return nelmiscJNI.CPath_getWindowsDirectory();
  }

  public static String getApplicationDirectory(String appName) {
    return nelmiscJNI.CPath_getApplicationDirectory__SWIG_0(appName);
  }

  public static String getApplicationDirectory() {
    return nelmiscJNI.CPath_getApplicationDirectory__SWIG_1();
  }

  public static String getTemporaryDirectory() {
    return nelmiscJNI.CPath_getTemporaryDirectory();
  }

  public static void releaseInstance() {
    nelmiscJNI.CPath_releaseInstance();
  }

}
